<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex flex-wrap align-center justify-between benben-position-layout flex passwordLogin_flex_0" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<text class='fu-iconfont2  testExamination_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">&#xE794;</text>
				<view class="title_text"></view>
				<view class="testExamination_fd0_0_c0_c0"></view>
			</view>
			<!-- <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view> -->
			
			<view class="store_info">
				<image class="store_1" :src='STATIC_URL+"401.png"' mode=""></image>
				<view class="store_2">全渠道高效获客·全场景运营提升</view>
			</view>
			<view class="bottom_content">
				<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout passwordLogin_flex_2">
					<!-- <view class="wxLogin flex align-center justify-center" @tap.stop="LoginFunc()">微信一键登录</view> -->
					<view class='flex flex-wrap align-center justify-center passwordLogin_fd2_2' @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/denglu/codeLogin/codeLogin`">
						<text class='passwordLogin_fd2_2_c1'>手机号/账号登录</text>
					</view>
					
				</view>
				<view style="height: 140rpx;"></view>
				<!-- <view class="flex flex-wrap align-center justify-center flex passwordLogin_flex_3">
					<benben-flex-switch-new class-name='flex flex passwordLogin_fd3_0' v-model="is_tick" :disabled='false'>
						<template v-slot:checked>
				
							<view class='flex flex position-relative align-center'>
								<image class='passwordLogin_checkfd3_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"7.png"'>
								</image>
							</view>
				
						</template>
						<template v-slot:unchecked>
				
							<view class='flex flex position-relative justify-end align-center'>
								<image class='passwordLogin_noCheckfd3_0_c1_c0' mode="aspectFit"
									:src='STATIC_URL+"8.png"'></image>
							</view>
				
						</template>
					</benben-flex-switch-new>
					<text class='passwordLogin_fd3_1'>我已阅读并同意</text>
					<text class='passwordLogin_fd3_2' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/denglu/agreement/agreement?aid=1`">用户注册协议</text>
					<text class='passwordLogin_fd3_1'>{{$t('与')}}</text>
					<text class='passwordLogin_fd3_2' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/denglu/agreement/agreement?aid=2`">隐私协议</text>
				</view> -->
			</view>
			
		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"popupShow1658998215973": false,
				"is_tick": false,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			
			//登录
			LoginFunc() {
				if (this.is_tick === false) {
					this.$message.info('请阅读并同意用户注册协议与隐私政策');
					return false;
				}
				uni.showLoading({
					title: '登录中...'
				})
				var _this = this;
				let code = '';
				uni.login({
					success: res => {
						console.log(res);
						code = res.code;
					},
					fail: err => {
						console.log(err);
					}
				})
				
				
				if (uni.getUserProfile) {
					uni.getUserProfile({
						desc: '用于完善会员资料',
						success: infoRes => {
							// console.log(code)
							console.log(infoRes);

							_this.$api.post(global.apiUrls.post5e48bf671910d, {
								encryptedData: infoRes.encryptedData,
								iv: infoRes.iv,
								code: code
							}).then(result => {
								result = result.data;
								console.log("后台返回登录信息", result)
								// return;
								if (result.code == 1) {
									uni.hideLoading();
									if (result.data.userinfo) {
										_this.$message.info(result.msg);
										//存入本地
										_this.$store.commit('updateUserInfo', result.data.userinfo);
										_this.$store.commit('saveToken', result.data.userinfo.user_token);
										setTimeout(() => {
											uni.switchTab({
												url: '/pages/tabBar/index/index'
											})
										}, 800)
									}
								} else if (result.code == -999) {
									uni.hideLoading();
									_this.$message.info('请绑定手机号');
									setTimeout(function() {
										uni.navigateTo({
											url: '/pages/denglu/getPhone/getPhone'
										})
									}, 800);
									// if (result.data.result) {
									// 	uni.setStorageSync('Wxinfo_tmp', result.data.result);
									// }
								} else {
									uni.hideLoading();
									_this.$message.info(result.msg);
								}
							}).catch(err => {
								console.log('ERROR', err);
								uni.hideLoading();
								_this.$message.info(err.msg);
							})
						}

					})
				}
			},
			openLogin() {
				if (this.is_tick === false) {
					this.$message.info('请阅读并同意用户注册协议与隐私政策');
					return false;
				}
				this.popupShow1658998215973 = true;
			},
		}
	};
</script>
<style lang="scss" scoped>
	.wxLogin {
		width: 642rpx;
		height: 96rpx;
		background: #00CAA5;
		border-radius: 16rpx;
		font-weight: 500;
		font-size: 30rpx;
		color: #FFFFFF;
	}
	.testExamination_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #fff;
	}
	.store_info {
		text-align: center;
		margin-top: 196rpx;
		.store_1 {
			width: 466rpx;
			height: 78rpx;
		}
		.store_2 {
			margin-top: 8rpx;
			font-weight: 400;
			font-size: 28rpx;
			color: #FFFFFF;
		}
	}
	.bottom_content {
		position: fixed;
		left: 0;
		bottom: calc(34rpx + var(--window-bottom));
	}
	.title_text {
		font-weight: bold;
		font-size: 32rpx;
		color: #111111;
	}
	.set_fd3_0 {
		line-height: 50rpx;
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		margin: 40rpx 0rpx 32rpx 0rpx;
		text-align: center;
	}
	
	.set_fd3_1 {
		line-height: 45rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
		margin: 0rpx 0rpx 37rpx 0rpx;
		text-align: center;
		padding: 0 30rpx;
	}
	
	.set_fd3_2_c0 {
		border-top: 1px solid #eee;
		border-right: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		width: 269rpx;
		height: 94rpx;
		line-height: 94rpx;
		font-weight: 500;
	}
	
	.set_fd3_2_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: #1593FF;
		width: 269rpx;
		height: 94rpx;
		line-height: 94rpx;
		font-weight: 500;
	}
	
	.set_flex_3 {
		background: #fff;
		background-size: 100% !important;
		width: 540rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}
	
	.set_fd2_0 {
		border: 1px solid #BFBFBF;
		background: rgba(255, 255, 255, 0.3900);
		background-size: 100% !important;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #333;
		width: 686rpx;
		height: 88rpx;
		line-height: 88rpx;
		font-weight: 500;
	}
	
	.set_flex_2 {
		width: 750rpx;
		height: 144rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
	}
	.tourist {
		font-size: 28rpx;
		color: #2BA5FF;
		margin-top: 32rpx;
		text-align: center;
	}
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://speed.zhongchuxing.com/gjdimages/400.png) no-repeat;
		background-color: #0773F0;
		background-size: 100% 100%;
	}

	.passwordLogin_flex_0 {
		width: 750rpx;
		height: 88rpx;
		position: relative;
		z-index: 10;
		padding: 0 32rpx;
	}

	.passwordLogin_flex_1 {
		padding: 90rpx 0rpx 147rpx 0rpx;
	}

	.passwordLogin_fd1_1 {
		color: #333333;
		font-size: 36rpx;
		font-weight: 500;
	}

	.passwordLogin_fd1_0 {
		width: 180rpx;
		height: 180rpx;
		margin: 0rpx 0rpx 40rpx 0rpx;
		border-radius: 16rpx;
	}

	.passwordLogin_flex_2 {
		padding: 0rpx 55rpx 0rpx 55rpx;
		position: relative;
		z-index: 10;
	}

	.passwordLogin_fd2_2_c1 {
		font-weight: 500;
		font-size: 30rpx;
		color: #1A66FA;
	}

	.passwordLogin_fd2_2 {
		margin-top: 20rpx;
		width: 640rpx;
		height: 98rpx;
		background: #fff;
		border-radius: 16rpx;
		
	}

	.passwordLogin_fd2_1 {
		color: #808080;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
		margin: 0rpx 0rpx 40rpx 0rpx;
	}

	.passwordLogin_fd2_0 {
		color: #1A1A1A;
		font-size: 32rpx;
		font-weight: 700;
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.passwordLogin_flex_3 {
		width: 750rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
		margin-top: 76rpx;
	}

	.passwordLogin_fd3_2 {
		font-weight: 500;
		font-size: 24rpx;
		color: rgba(255,255,255,0.8);
		text-decoration: underline;
		margin: 0 5rpx;
	}

	.passwordLogin_fd3_1 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(255,255,255,0.8);
	}

	.passwordLogin_noCheckfd3_0_c1_c0 {
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		width: 32rpx;
		height: 32rpx;
		margin: 6rpx 0rpx 0rpx 0rpx;
	}

	.passwordLogin_checkfd3_0_c0_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		margin: 6rpx 0rpx 0rpx 0rpx;
	}

	::v-deep .passwordLogin_fd3_0 {
		margin: 0rpx 16rpx 0rpx 0rpx;
		transform: translateY(-3rpx);
	}
</style>